//
//  LeftMenuTableViewController.m
//  guahao
//
//  Created by osx on 16/9/19.
//  Copyright © 2016年 osx. All rights reserved.
//

#import "LeftMenuTableViewController.h"
#import "Masonry.h"
#import "UIColor+randomColor.h"

@interface LeftMenuTableViewController ()

@property (strong,nonatomic) UIView* visitView;
//@property (strong,nonatomic)

@end

static NSString *identifier = @"collectionCell";

@implementation LeftMenuTableViewController


-(UIView *)visitView{
    
    if (!_visitView) {
        UIImageView *userHeadImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"name"]];
        UIButton *denglu = [[UIButton alloc] init];
        UIButton *zhuce = [[UIButton alloc] init];
        
        _visitView.backgroundColor = [UIColor redColor];
        [_visitView addSubview:userHeadImage];
        [_visitView addSubview:denglu];
        [_visitView addSubview:zhuce];
        
     //   userHeadImage.
    }

    return _visitView;
}





- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    
    self.view.backgroundColor = [UIColor blackColor];
    
    [self.tableView registerClass:[UITableViewCell self] forCellReuseIdentifier:identifier];
   // self.tableView.
    
    
    
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    
    if (section == 1) {
        return self.visitView;
    }
    return nil;
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
    //UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: forIndexPath:indexPath];
    
    // Configure the cell...
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
    cell.backgroundColor = [UIColor randomColor];
    
    return cell;
}

@end

